<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="format-detection" content="telephone=no">
    <meta name="format-detection" content="email=no">
    <script src="../assets/flexible/flexible.debug.js"></script>
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>自饮助手</title>
    <link rel="stylesheet" href="../css/reset.css">
    <link rel="stylesheet" href="../css/capsule.css">
    <link rel="stylesheet" href="../assets/swiper/css/swiper.min.css">
    <link rel="stylesheet" href="../assets/font/iconfont.css">
</head>

<body>

    <header class="header">
        <div class="iconfont left index">&#xe607;返回</div>
        <div class="center">自饮助手</div>
        <div class="right"></div>
    </header>
    <nav class="nav">
        <ul>
            <li class="self">自饮助手</li>
            <li class="on">自饮锦囊</li>
        </ul>
    </nav>
    <main class="main">
        <script type="text/html" id="template">
            {{each str v}}
            <dl>
                <dt><img src="{{v.img}}"></dt>
                <dd class="dd1">{{v.dd1}}</dd>
                <dd class="dd2">{{v.dd2}}</dd>
            </dl>
            {{/each}}
        </script>
    </main>
    <footer class="footer">
        没有更多了哟～
    </footer>
    <script src="../assets/jquery/jquery-3.2.1.min.js"></script>
    <script src="../js/index.js"></script>
    <script src="../assets/swiper/js/swiper.min.js"></script>
    <script src="../assets/artTemplate/template-web.js"></script>
    <script src="../assets/cookie/jquery.cookie.js"></script>
    <script>
        $(function () {
            $('.index').click(function () {
                location.href = "../index.html"
            })
            $('.self').click(function () {
                location.href = "../html/self.html"
            })
            $('li').click(function () {
                $(this).addClass('on').siblings().removeClass('on');
            });
        })

        jQuery(function ($) {
            $.ajax({
                type: "GET",
                url: "../json/capsule.json",
                dataType: 'json',
                success: function (data) {
                    var arr = template('template', {
                        str: data
                    });
                    $('.main').html(arr);
                }
            })
        })
    </script>
</body>

</html>